
from event.eventmanager import EventManager
from event.event_types import EVENT_UPDATE
import unittest


class  EventmanagerTestCase(unittest.TestCase):

    def setUp(self):
        self.em = EventManager()
        self.em.register_listener(self)

    def tearDown(self):
        self.em.unregister_listener(self)

    def receive(self, event, ev_manager):
        self.assertEqual(event, EVENT_UPDATE, "Event recieved incorrect")
        self.assertEqual(ev_manager, self.em, "Event received with incorrect manager")

    def test_post(self):
        self.em.post(EVENT_UPDATE)

if __name__ == '__main__':
    unittest.main()

